/*    */ package com.wgcloud.service;
/*    */ 
/*    */ import com.github.pagehelper.PageHelper;
/*    */ import com.github.pagehelper.PageInfo;
/*    */ import com.wgcloud.entity.IntrusionInfo;
/*    */ import com.wgcloud.mapper.IntrusionInfoMapper;
/*    */ import com.wgcloud.util.DateUtil;
/*    */ import com.wgcloud.util.UUIDUtil;
/*    */ import java.util.HashMap;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Service;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Service
/*    */ public class IntrusionInfoService
/*    */ {
/*    */   @Autowired
/*    */   private IntrusionInfoMapper intrusionInfoMapper;
/*    */   
/*    */   public PageInfo selectByParams(Map<String, Object> params, int currPage, int pageSize) throws Exception {
/* 28 */     PageHelper.startPage(currPage, pageSize);
/* 29 */     List<IntrusionInfo> list = this.intrusionInfoMapper.selectByParams(params);
/* 30 */     PageInfo<IntrusionInfo> pageInfo = new PageInfo(list);
/* 31 */     return pageInfo;
/*    */   }
/*    */   
/*    */   public void save(IntrusionInfo intrusionInfo) throws Exception {
/* 35 */     intrusionInfo.setId(UUIDUtil.getUUID());
/* 36 */     intrusionInfo.setCreateTime(DateUtil.getNowTime());
/* 37 */     this.intrusionInfoMapper.save(intrusionInfo);
/*    */   }
/*    */   
/*    */   public void saveRecord(List<IntrusionInfo> recordList) throws Exception {
/* 41 */     Map<String, Object> map = new HashMap<>();
/* 42 */     for (IntrusionInfo as : recordList) {
/* 43 */       as.setId(UUIDUtil.getUUID());
/* 44 */       map.put("hostname", as.getHostname());
/* 45 */       this.intrusionInfoMapper.deleteByAccHname(map);
/*    */     } 
/* 47 */     this.intrusionInfoMapper.insertList(recordList);
/*    */   }
/*    */   
/*    */   public int deleteById(String[] id) throws Exception {
/* 51 */     return this.intrusionInfoMapper.deleteById(id);
/*    */   }
/*    */   
/*    */   public IntrusionInfo selectById(String id) throws Exception {
/* 55 */     return this.intrusionInfoMapper.selectById(id);
/*    */   }
/*    */   
/*    */   public List<IntrusionInfo> selectAllByParams(Map<String, Object> params) throws Exception {
/* 59 */     return this.intrusionInfoMapper.selectAllByParams(params);
/*    */   }
/*    */   
/*    */   public List<IntrusionInfo> selectByAccountId(String accountId) throws Exception {
/* 63 */     return this.intrusionInfoMapper.selectByAccountId(accountId);
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/service/IntrusionInfoService.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */